1. Field of the Invention
This invention relates to cache buffer control methods and algorithms for hard disk and tape drives, and more particularly to methods and algorithms for organizing a cache buffer and identifying memory cells in the cache buffer that are available for reading and writing operations.
2. Description of the Related Art
In a typical computer system, data is processed in a host unit and stored in a memory for later retrieval and further processing. A commonly used memory is a hard disk or tape drive having a nonvolatile storage medium on which data is written and read in response to commands from the host unit. For easier understanding, this invention will be described in connection with a hard disk drive having a magnetic disk, but it is contemplated that the storage medium could be a magnetic disk drive, an optical disk drive, a tape drive, etc.
Writing and reading processes are controlled internally within the hard disk drive by a dedicated central processing unit (CPU) provided for disk drive control. Among other things, the CPU uses volatile memory such as a cache buffer in the hard disk drive (or in the host unit) to expedite writing and reading operations and more efficiently serve the host unit.
FIG. 17 shows a schematic structure of a known cache buffer. Each memory cell in the cache buffer has a memory address. The CPU stores data in the cache buffer according to these addresses, usually in blocks called LBAs (Logical Block Addresses). In FIG. 17, W1 represents data to be written to disk in response to a first write command, and W2-W5 represent data to be written in response to successive write commands. R1, R2 and R3 represent data to be read from the disk in response to successive read commands. Separate logical and/or physical cache buffers are used for reading and writing, respectively. The read and write buffers are ring buffers, so when the write buffer is filled, W5 data must be held until the cache is written to disk, or it overwrites W1 data. The situation is the same for the read buffer. In the alternative, the CPU must break up the data and store it among several areas of the cache buffer. Both the two-buffer regime of the cache buffer and the method of storing and overwriting data are inefficient and time consuming, and slow the response time of the hard disk drive. Accordingly, one object of this invention is to provide new and improved cache buffer control methods and algorithms for hard disk drives and the like.
Another object is to provide new and improved organizational schemes for memory cells in a cache buffer.
Still another object is to provide new and improved cache buffer control methods and apparatus for identifying available memory in a cache buffer for reading and writing data from and to a hard disk drive or the like.